'use strict';
const {
    Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
    class Cate extends Model {
        /**
         * Helper method for defining associations.
         * This method is not a part of Sequelize lifecycle.
         * The `models/index` file will call this method automatically.
         */
        static associate(models) {
            // 一对多
            models.Cate.hasMany(models.Article)
        }
    }
    Cate.init({
        cate_name: DataTypes.STRING,
        sort: DataTypes.INTEGER
    }, {
        sequelize,
        modelName: 'Cate',
    });
    return Cate;
};